#pragma once

#include <QtWidgets/QMainWindow>
#include "ui_TCPServer.h"

QT_BEGIN_NAMESPACE
namespace Ui { class TCPServerClass; };
QT_END_NAMESPACE


class QTcpServer;
class QTcpSocket;
class QUdpSocket;

class TCPServerEntity;

class TCPServer : public QMainWindow
{
    Q_OBJECT

public:
    TCPServer(QWidget *parent = nullptr);
    ~TCPServer();

private:
    Ui::TCPServerClass *ui;
    QTcpServer* m_tcpServer;

    QUdpSocket* m_udpSocket;

    TCPServerEntity* serverEntity;

    void conn();
};

class TCPServerEntity : public QObject
{
    Q_OBJECT

public:
	TCPServerEntity(QString ip, int port);
	~TCPServerEntity();

private:
    QTcpServer* m_tcpServer;
    void conn();

};
